﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace ProgrammingEducationSystem.Models
{
    //课程
    public class Course
    {
        public Guid Id { get; set; }
        [Required(ErrorMessage = "课程名称不可为空")]
        public string Name { get; set; }

        [ForeignKey(nameof(Class))]
        [Required(ErrorMessage = "班级Id不可为空")]
        public Guid ClassId { get; set; }
        public Class @class { get; set; }

        [ForeignKey(nameof(CourseType))]
        [Required(ErrorMessage = "课程类型Id不可为空")]
        public Guid CourseTypeId { get; set; }
        public CourseType Type { get; set; }

        public List<CourseHour>? courseHours { get; set; }
    }
}
